package com.hsq.commons.util;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 *
 * @since 2001-12-18
 * @author lijun
 * @version 1.0
 * @Copyright ? 2009 LinkCm Co. Ltd. All right reserved.
 */

public class ServletUtil {
	

	@SuppressWarnings("unchecked")
	public static Map<String,String> requestMap(Map<String,String[]> map){
		Map<String,String> newMap = new HashMap<String,String>();
		Set<?> st = map.entrySet();
		Iterator<?> it = st.iterator();
		while (it.hasNext()){
			Map.Entry<String,String[]> me = (Map.Entry<String,String[]>)it.next();
			String strKey = (String)me.getKey();  
			String[] value=(String[])me.getValue();  
			String valueStr="";
			for(int i=0;i <value.length;i++){  
			  if(i>0)
				  valueStr +=",";
			  valueStr += value[i];
			}
			newMap.put("param_"+strKey, valueStr);
		}
		return newMap;
	}

}
